<template>
  <div>
    父组件中显示name的值:{{obj.name}}
    父组件中显示age的值:{{obj.age}}
    <button @click="change">change</button>
    <MyDEB></MyDEB>
    <MyDEB2></MyDEB2>
  </div>
</template>
<script>
import Bus from './Bus.js'
import MyDEB from './MyDEB'
import MyDEB2 from './MyDEB2'
export default {
  components: {
    MyDEB,
    MyDEB2
  },
  data() {
    return {
      obj: Bus
    }
  },
  mounted() {
    this.obj.$on('postdata', (data) => {
      console.log(data)
    })
  },
  methods: {
    change() {
      this.obj.name = '123'
      this.obj.age = 12
    }
  }
}
</script>
